# 设置项目的最低 CMake 版本要求
cmake_minimum_required(VERSION 3.22.1)

# 设置项目名称
project("myndkdemo")

add_library(lib_curl SHARED IMPORTED)
set_target_properties(lib_curl PROPERTIES IMPORTED_LOCATION
        ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libcurl.so)

# 添加 C++ 库
add_library( # 库名称
        mylib
        # 设置为共享库
        SHARED
        # 源文件路径
        src/main/cpp/native-lib.cpp
)

# 指定libcurl的头文件路径
include_directories("${CMAKE_SOURCE_DIR}/src/main/cpp/include")




set(EVENT_ROOT "${CMAKE_SOURCE_DIR}/src/main/cpp/libevent/")
set(EVENT_LIBRARY_DIR "${EVENT_ROOT}/lib")
include_directories("${EVENT_ROOT}/include")


# 设置 Boost 库的路径
set(BOOST_ROOT "${CMAKE_SOURCE_DIR}/src/main/cpp/boost/arm64-v8a")
set(Boost_INCLUDE_DIR "${BOOST_ROOT}/include/boost-1_85")
set(BOOST_LIBRARY_DIR "${BOOST_ROOT}/lib")

# 添加头文件路径
include_directories(${BOOST_INCLUDE_DIR})

set(Boost_NO_WARN_NEW_VERSIONS 1)

find_package(Boost REQUIRED)

message(STATUS "VariableName = ${lib_curl}")

## 将 log 库与本地库链接
target_link_libraries(
        mylib
        android
        log
        EGL
        GLESv2
        lib_curl
        Boost::boost
        "${BOOST_LIBRARY_DIR}/libboost_filesystem-clang-mt-a64-1_85.a"
        "${EVENT_LIBRARY_DIR}/libevent.so"
        "${EVENT_LIBRARY_DIR}/libevent-2.2.so"
        "${BOOST_LIBRARY_DIR}/libboost_timer-clang-mt-a64-1_85.a"
)


